package a.f.l.a;

import a.c.d;
import a.c.e;
import a.d.t;
import a.d.w;
import a.f.ad;
import a.f.tb;
import a.f.zc;
import a.i.db;

import java.util.Iterator;
import java.util.List;

class fc
  extends sb
  implements p
{
  private static final boolean f = true;
  private static final boolean g = false;
  private r h;
  private List i;
  private List j;
  private List k;
  private int l;
  private boolean m;
  private boolean n;
  
  protected void a(qb paramqb)
  {
    super.a(paramqb);
    paramqb.a().a(gb.a, db.a());
  }
  
  protected void c()
  {
    a().a().j(gb.a);
    super.c();
    this.h = null;
    this.i = null;
    this.j = null;
    this.k = null;
  }
  
  protected void b(rb paramrb)
  {
    boolean bool = sb.e;
    super.b(paramrb);
    d locald = paramrb.d();
    a.f.o localo = a().a();
    this.l = paramrb.e().f().o();
    if (!bool)
    {
      if (this.l <= 0)
      {
        this.n = false;
        return;
      }
      this.h = a().a(locald);
      this.i = this.h.c(true);
      this.j = this.h.c(false);
    }
    if (!bool) {
      if (this.i != null)
      {
        if (bool) {
          break label151;
        }
        if (this.i.size() > 0) {
          break label150;
        }
      }
    }
    if ((bool) || (this.j != null)) {
      if (bool) {}
    }
    label150:
    label151:
    this.n = (this.j.size() > 0);
    if (!bool) {
      if (!this.n) {
        return;
      }
    }
    List localList = this.h.e(true);
    if (!bool)
    {
      if (localList.size() > 0) {
        a(localo, locald, localList, true);
      }
      this.k = this.h.e(false);
    }
    if (!bool)
    {
      if (this.k.size() > 0) {
        a(localo, locald, this.k, false);
      }
    }
    else {
      paramrb.a().a(this);
    }
  }
  
  private void a(a.f.o paramo, d paramd, List paramList, boolean paramBoolean)
  {
    boolean bool = sb.e;
    int i1 = sb.d;
    e locale = paramBoolean ? paramd.e() : paramd.f();
    zc localzc = paramo.d(locale);
    Iterator localIterator1 = paramList.iterator();
    label229:
    do
    {
      mb localmb;
      do
      {
        do
        {
          Iterator localIterator2;
          do
          {
            w localw;
            do
            {
              if (!localIterator1.hasNext()) {
                break;
              }
              localw = this.h.a((ad)localIterator1.next(), paramBoolean);
            } while (t.a(localzc.a(), localzc.b(), localzc.c(), localzc.d(), localw.a(), localw.b()));
            List localList = a().c().t().a(new t(localw.a(), localw.b(), 0.0D, 0.0D));
            if (bool) {
              break;
            }
            localIterator2 = localList.iterator();
          } while (!localIterator2.hasNext());
          localmb = (mb)localIterator2.next();
        } while (i1 != 0);
        if (!paramBoolean) {
          break;
        }
        b().a(localmb);
        if (bool) {
          break label229;
        }
      } while (i1 == 0);
      b().c(localmb);
    } while (i1 == 0);
  }
  
  protected void c(rb paramrb)
  {
    boolean bool = sb.e;
    super.c(paramrb);
    if (((bool) || (this.n)) && ((bool) || (this.k.size() > 0))) {
      paramrb.a().b(this);
    }
  }
  
  protected void d(rb paramrb)
  {
    boolean bool = sb.e;
    super.d(paramrb);
    if (((bool) || (this.n)) && ((bool) || (this.k.size() > 0))) {
      paramrb.a().b(this);
    }
  }
  
  double[] a(h paramh, mb parammb, jb[] paramArrayOfjb, m[] paramArrayOfm, double[] paramArrayOfDouble)
  {
    boolean bool = sb.e;
    int i1 = sb.d;
    if (!bool) {
      if (!this.n)
      {
        b("source port penalty", 0.0D, false);
        b("target port penalty", 0.0D, false);
        return new double[paramArrayOfjb.length];
      }
    }
    this.m = (this.i != null);
    h localh = paramh;
    do
    {
      do
      {
        if (!this.m) {
          break;
        }
        if (!bool)
        {
          if (localh == null) {
            break;
          }
          this.m = b().b(localh.a());
        }
        localh = localh.b();
      } while (i1 == 0);
    } while (bool);
    return super.a(paramh, parammb, paramArrayOfjb, paramArrayOfm, paramArrayOfDouble);
  }
  
  protected double a(h paramh, mb parammb, jb paramjb, m paramm, double paramDouble)
  {
    boolean bool = sb.e;
    int i1 = sb.d;
    mb localmb = paramh.a();
    double d1 = 0.0D;
    Object localObject;
    if (!bool)
    {
      if (this.m)
      {
        d1 = this.l;
        List localList = this.h.a(localmb, parammb, paramjb, true);
        Iterator localIterator1 = localList.iterator();
        do
        {
          if (!localIterator1.hasNext()) {
            break;
          }
          localObject = (ad)localIterator1.next();
          d1 = Math.min(d1, ((ad)localObject).f());
          if (bool) {
            break label134;
          }
          if (i1 != 0) {
            break label124;
          }
        } while (i1 == 0);
      }
      if (bool) {}
    }
    else
    {
      a("source port penalty", d1, false);
    }
    label124:
    if (!bool) {
      if (d1 > paramDouble) {
        return d1;
      }
    }
    label134:
    double d2 = 0.0D;
    if (!bool)
    {
      if (this.j != null)
      {
        if (bool) {
          break label256;
        }
        if (b().d(parammb))
        {
          d2 = this.l;
          localObject = this.h.a(localmb, parammb, paramjb, false);
          Iterator localIterator2 = ((List)localObject).iterator();
          do
          {
            if (!localIterator2.hasNext()) {
              break;
            }
            ad localad = (ad)localIterator2.next();
            if (bool) {
              break label269;
            }
            d2 = Math.min(d2, localad.f());
            if (i1 != 0) {
              break label264;
            }
          } while (i1 == 0);
        }
      }
      if (bool) {
        break label264;
      }
    }
    label256:
    a("target port penalty", d2, false);
    label264:
    label269:
    return d1 + d2;
  }
  
  public void a(h paramh, mb parammb, jb paramjb, List paramList, rb paramrb)
  {
    boolean bool = sb.e;
    int i1 = sb.d;
    if ((bool) || ((this.k.size() > 0) && (paramrb.d(parammb))))
    {
      List localList = this.h.a(this.k, paramh.a(), parammb, false);
      Iterator localIterator = localList.iterator();
      do
      {
        do
        {
          double d;
          do
          {
            if (!localIterator.hasNext()) {
              break;
            }
            ad localad = (ad)localIterator.next();
            w localw = this.h.a(localad, false);
            d = paramjb.a() ? localw.b() : localw.a();
          } while (!paramjb.e().a(d));
          paramList.add(new jb(d, d, paramjb.f(), paramjb.a()));
        } while (bool);
      } while (i1 == 0);
    }
  }
  
  protected double a(h paramh)
  {
    boolean bool = sb.e;
    int i1 = sb.d;
    if (!this.n) {
      return 0.0D;
    }
    h localh = paramh.b();
    double d = 0.0D;
    if ((localh != null) && ((bool) || (this.i != null)) && ((bool) || (b().b(localh.a()))))
    {
      d = this.l;
      List localList = this.h.a(localh.a(), paramh.a(), paramh.c(), true);
      Iterator localIterator = localList.iterator();
      do
      {
        if (!localIterator.hasNext()) {
          break;
        }
        ad localad = (ad)localIterator.next();
        if (!bool)
        {
          if (i1 != 0) {
            break label146;
          }
          d = Math.min(d, localad.f());
        }
      } while (i1 == 0);
    }
    label146:
    return d;
  }
  
  protected void a(List paramList)
  {
    boolean bool = sb.e;
    int i3 = sb.d;
    if (!bool) {
      if (!this.n) {
        return;
      }
    }
    List localList1 = this.h.e(true);
    if (localList1.isEmpty()) {
      return;
    }
    rb localrb = b();
    int i1 = 0;
    int i2 = localrb.f();
    label60:
    label107:
    label108:
    label115:
    do
    {
      if (i1 >= i2) {
        break;
      }
      mb localmb1 = localrb.a(i1);
      h localh1 = new h(localmb1);
      s locals = a().c().t();
      Iterator localIterator1 = locals.c(localmb1).iterator();
      do
      {
        break label175;
        break label175;
        mb localmb2;
        do
        {
          if (!localIterator1.hasNext()) {
            break;
          }
          localmb2 = (mb)localIterator1.next();
        } while (localrb.b(localmb2));
        jb localjb1 = pb.a(localmb1, localmb2);
        List localList2 = this.h.a(localList1, localmb1, localmb2, true);
        Iterator localIterator2 = localList2.iterator();
        do
        {
          if (!localIterator2.hasNext()) {
            break label108;
          }
          ad localad = (ad)localIterator2.next();
          w localw = this.h.a(localad, true);
          if (bool) {
            break label60;
          }
          if (i3 != 0) {
            break;
          }
          double d = localjb1.a() ? localw.b() : localw.a();
          if (!localjb1.e().a(d)) {
            break label107;
          }
          tb localtb = pb.a(localh1, localmb2);
          jb localjb2 = new jb(d, d, localjb1.f(), localjb1.a());
          h localh2 = new h(localmb2);
          localh2.a(localtb);
          localh2.a(localjb2);
          localh2.a(localh1);
          paramList.add(localh2);
          if (bool) {
            break label115;
          }
          if (bool) {
            break label358;
          }
          if (i3 != 0) {
            break label356;
          }
        } while (bool);
      } while (i3 == 0);
      i1++;
    } while (i3 == 0);
    label175:
    label356:
    label358:
    return;
  }
  
  protected void a(lc paramlc)
  {
    boolean bool = sb.e;
    int i1 = sb.d;
    super.a(paramlc);
    a.c.m localm = b().c();
    do
    {
      if (!localm.e()) {
        break;
      }
      d locald = localm.a();
      ob localob = paramlc.b(locald);
      if (!bool)
      {
        if (localob != null)
        {
          r localr = a().a(locald);
          localr.c(localob, true);
          localr.c(localob, false);
          a(localob, localr, true);
          a(localob, localr, false);
        }
        localm.f();
      }
    } while (i1 == 0);
  }
  
  private void a(ob paramob, r paramr, boolean paramBoolean)
  {
    boolean bool = sb.e;
    List localList1 = paramr.a(paramob, paramBoolean);
    if ((bool) || (localList1.size() > 0))
    {
      List localList2 = paramr.a(localList1);
      ad localad = (bool) || (localList2.size() > 0) ? (ad)localList2.get(0) : null;
      if (localad != null)
      {
        w localw = paramr.a(localad, paramBoolean);
        n localn = b().k().a(paramob);
        if (!bool)
        {
          if (paramBoolean)
          {
            if (bool) {
              break label126;
            }
            localn.a(localw);
          }
        }
        else if (sb.d == 0) {
          return;
        }
        label126:
        localn.b(localw);
      }
    }
  }
}



/* Location:           E:\idea\

 * Qualified Name:     a.f.l.a.fc

 * JD-Core Version:    0.7.0.1

 */